Sort array of objects based first on a subarray and then on dates (without splitting the array)

join shbcf.ru